package com.example.zhihuigongdi.controller;


import com.example.zhihuigongdi.entity.DTO.LoginFormDTO;
import com.example.zhihuigongdi.entity.respon.Result;
import com.example.zhihuigongdi.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liuhongbin
 * @since 2024-04-17
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    @Lazy
    private IUserService userService;

    @PostMapping("/login")
    public Result login(@RequestBody LoginFormDTO loginFormDTO){
        return userService.login(loginFormDTO);
    }

    @GetMapping("/me")
    public Result getMe(){
        return userService.getMe();
    }

}
